package com.ljm.sys.auth.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
    * 系统资源
    * </p>
 *
 * @author HuamingChen
 * @since 2020-06-11
 */

@ApiModel(value="SysAuthResourceDto对象", description="系统资源")
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class SysAuthResourceDto implements Serializable {
    private static final long serialVersionUID = 1L;

    public SysAuthResourceDto() {
    }

    public SysAuthResourceDto(String resName, String permissionCode, String resPath, String resFullPath,Integer pageNo,Integer pageSize) {
        this.resName = resName;
        this.permissionCode = permissionCode;
        this.resPath = resPath;
        this.resFullPath = resFullPath;
        this.pageNo=pageNo;
        this.pageSize=pageSize;
    }

    @ApiModelProperty(value = "主键")
    private Long id;

    @ApiModelProperty(value = "父id")
    private Long parentId;

    @ApiModelProperty(value = "版本号")
    private Long version;

    @ApiModelProperty(value = "创建人")
    private String creater;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "修改人")
    private String editor;

    @ApiModelProperty(value = "修改时间")
    private LocalDateTime editTime;

    @ApiModelProperty(value = "状态：-1注销、1正常、0冻结")
    private Integer status;

    @ApiModelProperty(value = "是否删除0否1是")
    private Boolean isDelete;

    @ApiModelProperty(value = "资源名称")
    private String resName;

    @ApiModelProperty(value = "权限code")
    private String permissionCode;

    @ApiModelProperty(value = "权限层级code")
    private String permissionFullCode;

    @ApiModelProperty(value = "资源路径")
    private String resPath;

    @ApiModelProperty(value = "资源访问全路径")
    private String resFullPath;

    @ApiModelProperty(value = "资源类型")
    private Integer fdType;

    @ApiModelProperty(value = "排序")
    private Integer sort;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "机构id")
    private String orgId;

    @ApiModelProperty(value="是否登录可见 1--可见；0--需认证")
    private Boolean fdLoginVisible;

    @ApiModelProperty(value = "页码")
    private Integer pageNo;

    @ApiModelProperty(value = "页大小")
    private Integer pageSize;

    private boolean hasChildren;

    private List<SysAuthResourceDto> children;

    public boolean isHasChildren() {
        return fdType!=2;
    }

    public void setHasChildren(boolean hasChildren) {
        this.hasChildren = hasChildren;
    }
}
